import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryGeneralStaffStation = (params) => {
  params.head.transCode = 'queryGeneralStaffStation';
  return request({
    url: '/general/generalStaffStation/queryGeneralStaffStation',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryGeneralStaffStationListPage = (params) => {
  params.head.transCode = 'queryGeneralStaffStationListPage';
  return request({
    url: '/general/generalStaffStation/queryGeneralStaffStationListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveGeneralStaffStation = (params) => {
  params.head.transCode = 'saveGeneralStaffStation';
  return request({
    url: '/general/generalStaffStation/saveGeneralStaffStation',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveGeneralStaffStationList = (params) => {
  params.head.transCode = 'saveGeneralStaffStationList';
  return request({
    url: '/general/generalStaffStation/saveGeneralStaffStationList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateGeneralStaffStation = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralStaffStation';
  return request({
    url: '/general/generalStaffStation/saveOrUpdateGeneralStaffStation',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateGeneralStaffStationList = (params) => {
  params.head.transCode = 'saveOrUpdateGeneralStaffStationList';
  return request({
    url: '/general/generalStaffStation/saveOrUpdateGeneralStaffStationList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateGeneralStaffStation = (params) => {
  params.head.transCode = 'updateGeneralStaffStation';
  return request({
    url: '/general/generalStaffStation/updateGeneralStaffStation',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteGeneralStaffStation = (params) => {
  params.head.transCode = 'deleteGeneralStaffStation';
  return request({
    url: '/general/generalStaffStation/deleteGeneralStaffStation',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteGeneralStaffStationList = (params) => {
  params.head.transCode = 'deleteGeneralStaffStationList';
  return request({
    url: '/general/generalStaffStation/deleteGeneralStaffStationList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportGeneralStaffStationExcel = (params) => {
  downloadExcel({
    url: '/general/generalStaffStation/excelDownload/exportGeneralStaffStationExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
